/*测试发送多条请求粘包的处理结果*/

#include <cassert>
#include "../HttpServer.hpp"


int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8080, "127.0.0.1");
    std::string req = "GET /login HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    req += "GET /login HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    req += "GET /login HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";

    while(1) {
        assert(cli_sock.Send((char*)req.c_str(), req.size()) != -1);
        char buf[1024] = {0};
        assert(cli_sock.Recv(buf, 1023));
        LOG(LogLevel::DEBUG) << buf;
        sleep(3);
    }
    cli_sock.Close();
    return 0;
}